<?php
/**
 * Created by PhpStorm.
 * User: guobao
 * Date: 2018/6/16
 * Time: 14:28
 */
namespace menghe\view;
class Base{
    private $var=[];
    private $file;
    public function make($tpl=''){
        $this->file= '../app/'.MODULE.'/view/'.CONTROLLER.'/'.($tpl?:ACTION).'.'.config('view.suffix');
        return $this;
    }
    public function with($var){
        $this->var=$var;
        return $this;
    }
    public function __toString()
    {
        extract($this->var);
        include $this->file;
        return '';
    }
}